		
		* Table A6
		* School Finance Reform and Per-Pupil Revenue and Expenditures

		
		clear all
		set more off
	
		use "C:\Users\EAsker\Desktop\ABR\data\ABR_final_data"
		
		**************** Drop 2nd and 3rd quartiles ****************************
		
		drop if qrdinc80_b==2|qrdinc80_b==3
		
		************************************************************************
		/* Obtain estimates of district-level finance variables for 
		districts that have at least one student enrolled in our survey data. 
		 */
		 
	    egen student_id=group(stu_id survey)
		duplicates drop student_id, force
		
		** drop is current expenditure per-pupil is missing. 
		
		drop if mean_rcexp==.
		
		gen ln_dmedinc80=log(dmedinc80)

		************************************************************************
		************************************************************************
		
		local controls "dpblack80 dpurban80 dpcol80"
	
	foreach y of varlist mean_rev_87 mean_rtrev_87 mean_rtexp_87 mean_rcexp_87{
	
		************** BHJ
		reghdfe `y' qr1_sfr_exp_trend_BHJ  qr1_sfr_BHJ `controls', ///
		absorb(statexsurvey_quartile quartilexstate quartilexsurvey) ///
		cluster (quartilexstate) 
		
		outreg2 using Table_A6.xls, append ctitle(`y') bdec(4) nonotes nocons ///
		keep(qr1_sfr_exp_trend_BHJ  qr1_sfr_BHJ dpblack80 dpurban80 dpcol80 ) ///
		addtext(Control, YES, State by Survey FE, YES, Quartile by State FE, ///
		YES, Quartile by Survey FE, YES) 
		
		reghdfe `y' qr1_sfr_exp_trend_BHJ  qr1_sfr_BHJ, ///
		absorb(statexsurvey_quartile quartilexstate quartilexsurvey) ///
		cluster (quartilexstate) 
		
		outreg2 using Table_A6.xls, append ctitle(`y') bdec(4) nonotes nocons ///
		keep(qr1_sfr_exp_trend_BHJ  qr1_sfr_BHJ) addtext(Control, NO, State by ///
		Survey FE, YES, Quartile by State FE, YES, Quartile by Survey FE, YES)
		
	}
	